package com.ithuaxin.identifier;

import java.util.Random;
import java.util.Scanner;

public class RandomTest {
    public static void main(String[] args) {
        Random r = new Random();
        int a = r.nextInt(100)+1;
        Scanner sc = new Scanner(System.in);

        while (true){
            System.out.println("请输入一个整数");
            int b = sc.nextInt();
            if (b==a){
                System.out.println("恭喜你猜对了");
                break;
            }
            else if (b>a){
                System.out.println("猜大了");
            }
            else{
                System.out.println("猜小了");
            }
        }

    }
}
